/* =================================
   通用背景组件样式
   ================================= */

/* 页面容器 */
.page-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: var(--space-xl);
}

/* 页面标题区域 */
.page-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    color: white;
}

.page-title {
    font-size: var(--font-3xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    color: var(--primary-green);
}

.page-title i {
    font-size: 3rem;
    color: var(--accent-cyan);
}

.page-subtitle {
    font-size: var(--font-xl);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

/* 背景展示区域 */
.bg-showcase {
    margin-bottom: var(--space-2xl);
}

.bg-section {
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-size: var(--font-2xl);
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-green);
}

.section-title i {
    color: var(--primary-green);
    font-size: var(--font-xl);
}

/* 背景网格布局 */
.bg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

/* 背景演示卡片 */
.bg-demo-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--duration-normal) ease;
}

.bg-demo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-green);
}

/* 背景预览区域 */
.bg-preview {
    height: 200px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.bg-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    text-align: center;
    color: white;
}

.bg-overlay h3 {
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--primary-green);
}

.bg-overlay p {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.8);
}

/* 背景信息区域 */
.bg-info {
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.bg-info h4 {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: var(--space-sm);
    font-family: 'Courier New', monospace;
}

.bg-info p {
    font-size: var(--font-base);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* =================================
   背景样式类定义
   ================================= */

/* 主要背景样式 */
.bg-dark-gradient {
    background: linear-gradient(135deg, #0f172a, #1e293b, #334155);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

.bg-tech-grid {
    background: 
        linear-gradient(rgba(76, 175, 80, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(76, 175, 80, 0.1) 1px, transparent 1px),
        linear-gradient(135deg, #0f172a, #1e293b);
    background-size: 30px 30px, 30px 30px, 100% 100%;
    position: relative;
}

.bg-tech-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(76, 175, 80, 0.1) 0%, transparent 50%);
}

.bg-starfield {
    background: radial-gradient(circle, #0f172a 0%, #000000 100%);
    position: relative;
    overflow: hidden;
}

.bg-starfield::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, white 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle at 45% 15%, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px, 200px 200px, 250px 250px;
    animation: starTwinkle 4s ease-in-out infinite alternate;
}

.bg-map-base {
    background: #1a202c;
    border: 2px solid rgba(76, 175, 80, 0.3);
    position: relative;
}

.bg-map-base::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 24%, rgba(76, 175, 80, 0.05) 25%, rgba(76, 175, 80, 0.05) 26%, transparent 27%),
        linear-gradient(-45deg, transparent 24%, rgba(0, 255, 255, 0.05) 25%, rgba(0, 255, 255, 0.05) 26%, transparent 27%);
    background-size: 60px 60px;
}

/* 辅助背景样式 */
.bg-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bg-card {
    background: rgba(29, 43, 64, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.bg-solid {
    background: #1e293b;
}

.bg-gradient-border {
    background: 
        linear-gradient(#1e293b, #1e293b) padding-box,
        linear-gradient(45deg, var(--primary-green), var(--accent-cyan), var(--accent-orange)) border-box;
    border: 2px solid transparent;
    position: relative;
}

.bg-gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-green), var(--accent-cyan), var(--accent-orange));
    border-radius: inherit;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
}

/* 特效背景样式 */
.bg-particles {
    background: radial-gradient(ellipse at bottom, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.bg-particles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(76, 175, 80, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 152, 0, 0.2) 0%, transparent 50%);
    animation: particleFloat 6s ease-in-out infinite alternate;
}

.bg-data-stream {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.bg-data-stream::before {
    content: '010110100101011010010101101001010110100101011010010101101001';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(76, 175, 80, 0.3);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.2;
    animation: dataFlow 5s linear infinite;
    overflow: hidden;
}

.bg-neon-glow {
    background: #0f172a;
    position: relative;
    box-shadow: 
        inset 0 0 50px rgba(76, 175, 80, 0.2),
        inset 0 0 100px rgba(0, 255, 255, 0.1);
}

.bg-neon-glow::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(76, 175, 80, 0.5);
    border-radius: inherit;
    box-shadow: 
        0 0 20px rgba(76, 175, 80, 0.3),
        inset 0 0 20px rgba(76, 175, 80, 0.1);
    animation: neonPulse 2s ease-in-out infinite alternate;
}

.bg-circuit {
    background: #1a202c;
    position: relative;
    overflow: hidden;
}

.bg-circuit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 0%, rgba(76, 175, 80, 0.3) 50%, transparent 100%) 0 10px,
        linear-gradient(0deg, transparent 0%, rgba(0, 255, 255, 0.3) 50%, transparent 100%) 10px 0,
        radial-gradient(circle at 50px 50px, rgba(76, 175, 80, 0.5) 2px, transparent 2px);
    background-size: 100px 20px, 20px 100px, 100px 100px;
    animation: circuitPulse 3s ease-in-out infinite;
}

/* 使用说明样式 */
.usage-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 12px;
}

.usage-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.usage-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.usage-item h3 {
    font-size: var(--font-lg);
    color: var(--accent-cyan);
    margin-bottom: var(--space-md);
    font-weight: 600;
}

.usage-item code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    color: var(--primary-green);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    font-size: var(--font-sm);
    border: 1px solid rgba(76, 175, 80, 0.2);
    word-break: break-all;
}

/* =================================
   动画定义
   ================================= */

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes starTwinkle {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

@keyframes borderRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes particleFloat {
    0% { 
        transform: translateY(10px) scale(1);
        opacity: 0.7;
    }
    100% { 
        transform: translateY(-10px) scale(1.05);
        opacity: 1;
    }
}

@keyframes dataFlow {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50px); }
}

@keyframes neonPulse {
    0% { 
        box-shadow: 
            0 0 20px rgba(76, 175, 80, 0.3),
            inset 0 0 20px rgba(76, 175, 80, 0.1);
    }
    100% { 
        box-shadow: 
            0 0 40px rgba(76, 175, 80, 0.6),
            inset 0 0 40px rgba(76, 175, 80, 0.2);
    }
}

@keyframes circuitPulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .page-container {
        padding: var(--space-lg);
    }
    
    .bg-grid {
        grid-template-columns: 1fr;
    }
    
    .usage-content {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* 工具类 - 快速应用背景 */
.bg-full-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

.bg-container {
    position: relative;
    overflow: hidden;
}

.bg-overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.bg-overlay-light {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}
